<?php

/**
 * Louder Cache
 *
 * LICENSE
 *
 * This source file is subject to the New BSD License that is bundled
 * with this package in the file docs/LICENSE.txt.
 *
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to info@loudertechnology.com so we can send you a copy immediately.
 *
 * @category Louder
 * @package Autoloader
 * @copyright Copyright (c) 2005-2009 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
 * @license New BSD License
 */

/**
 * Class to autoload
 *
 * @category Louder
 * @package Autoloader
 * @copyright Copyright (c) 2005-2009 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
 * @license New BSD License
 * @param string $className
 */
function Autoload($className){

	$classPath = array(
		'ClusterConfig' => 'Louder/ClusterConfig/ClusterConfig',
		'ClusterConfigException' => 'Louder/ClusterConfig/ClusterConfigException',
		'ClusterNode' => 'Louder/ClusterNode/ClusterNode',
		'ClusterNodeManager' => 'Louder/ClusterNodeManager/ClusterNodeManager',
		'ClusterRequest' => 'Louder/ClusterRequest/ClusterRequest',
		'ClusterServer' => 'Louder/ClusterServer/ClusterServer',
		'ClusterServerException' => 'Louder/ClusterServer/ClusterServerException',
		'Config' => 'Kumbia/Config/Config',
		'ConfigException' => 'Kumbia/Config/ConfigException',
		'Core' => 'Kumbia/Core/Core',
		'CoreException' => 'Kumbia/Core/CoreException',
		'LoadBalancer' => 'Louder/LoadBalancer/LoadBalancer',
		'LoadBalancerException' => 'Louder/LoadBalancer/LoadBalancerException',
		'Logger' => 'Kumbia/Logger/Logger',
		'LoggerException' => 'Kumbia/Logger/LoggerException',
		'MemoryRegistry' => 'Louder/MemoryRegistry/MemoryRegistry',
		'NodeCommunicator' => 'Louder/NodeCommunicator/NodeCommunicator',
		'Object' => 'Kumbia/Object'
	);

	if(isset($classPath[$className])){
		require "Library/".$classPath[$className].".php";
	}
}